/*
 * @Author: tanjunyi@doctorwork.com
 * @Date: 2020-05-20 14:30:10
 * @LastEditors: tanjunyi@doctorwork.com
 * @LastEditTime: 2020-05-20 14:47:10
 * @Description:
 */


let obj = {
	name: 'Caroline'
}

const handler = {
	get(target, key, reciever) {
		console.log("正在访问属性:", key)
		return Reflect.get(target, key, reciever);
	},
	set(target, key, value, reciever) {
		console.log("正在设置属性:", key)
		return Reflect.set(target, key, value, reciever);
	}
}
Object.defineProperty(obj, 'age', {
	get(target, key, reciever) {
		console.log("正在访问属性:", key)
		return Reflect.get(target, key, reciever);
	},
	set(target, key, value, reciever) {
		console.log("正在设置属性:", key)
		return Reflect.set(target, key, value, reciever);
	}
});

obj.age = 9